package com.cyy.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyy.springbootinit.model.dto.readhistory.ReadingHistoryQueryRequest;
import com.cyy.springbootinit.model.entity.Dormitory;
import com.cyy.springbootinit.model.entity.ReadingHistory;
import com.cyy.springbootinit.model.vo.ReadingHistoryVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 抄表历史表服务
 *
 * @author 程序员cyy</a>
 * @from cyy</a>
 */
public interface ReadingHistoryService extends IService<ReadingHistory> {

    /**
     * 校验数据
     *
     * @param readingHistory
     * @param add 对创建的数据进行校验
     */
    void validReadingHistory(ReadingHistory readingHistory, boolean add);

    /**
     * 获取查询条件
     *
     * @param readingHistoryQueryRequest
     * @return
     */
    QueryWrapper<ReadingHistory> getQueryWrapper(ReadingHistoryQueryRequest readingHistoryQueryRequest);
    
    /**
     * 获取抄表历史表封装
     *
     * @param readingHistory
     * @param request
     * @return
     */
    ReadingHistoryVO getReadingHistoryVO(ReadingHistory readingHistory, HttpServletRequest request);

    /**
     * 分页获取抄表历史表封装
     *
     * @param readingHistoryPage
     * @param request
     * @return
     */
    Page<ReadingHistoryVO> getReadingHistoryVOPage(Page<ReadingHistory> readingHistoryPage, HttpServletRequest request);

    List<ReadingHistory> TwoLastData(List<Integer> equipmentIds);
}
